﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BLL.Interface;
using DAL.Dao;
using DAL.Models;

namespace BLL
{
    public class ManagerImpl : IManagerImpl
    {
        private readonly ManagerDaoimpl _dao;
        public int ExistNum { get { return _dao.ExistNum; } private set { } }
        public ManagerImpl()
        {
                _dao = new ManagerDaoimpl();
        }
        public IList<Manager> GetList()
        {
            return _dao.GetList();
        }

        public (int,IList<Manager>) GetList(int rows,int page)
        {
            return _dao.GetList(rows,page); 
        }
        public bool Delete(int id)
        {
          return _dao.Delete(id);   
        }

        public Manager? Find(int id)
        {
            return _dao.Find(id);    
        }

        public bool Update(int id,Manager manager)
        {
            return _dao.Update(id,manager);
        }
        public bool Add(Manager manager)
        {
            return _dao.Add(manager);
        }
        public Manager? Login(string username, string userpass)
        {
            return _dao.Login(username, userpass);
        }
        public Manager? GetItemByID(int id)
        {
           
            return  _dao.GetItemByID(Convert.ToInt32(id));
         
        }

   
    }
}
